#import "sprite_game_enemy_3.h"

@implementation SpriteGameEnemy3

- (id)initSpriteGameEnemy3
{
	if ((self = [super initSpriteGameEnemy]))
	{
		objectName_ = "object sprite game enemy type 3";
		
		/*box2d
		*/
		b2Fixture *fixtureBody_;
	}
	return self;
}

- (void)createBody
{
	int i;
	int _VertexCount;
	float _Ratio;
	b2Vec2 *_Vertex;
	b2PolygonShape _PolygonShape;
	b2FixtureDef _FixtureDef;
	
	[super createBody];
	
	_Ratio = 1 / CMgrGamePhysics::Ratio();
	_FixtureDef.density = 1.0f;
	_FixtureDef.isSensor = true;
	
	_VertexCount = g_CfgGameEnemyDataTable[3].box2d_collision_point_table_body.size();
	_Vertex = ptCreateCollisionVertex(&g_CfgGameEnemyDataTable[3].box2d_collision_point_table_body);
	for (i = 0; i < _VertexCount; ++i)
	{
		_Vertex[i] = ptScaleVector_same(_Vertex[i], _Ratio);
	}
	_PolygonShape.Set(_Vertex, _VertexCount);
	free(_Vertex);
	_FixtureDef.shape = &_PolygonShape;
	fixtureBody_ = box2dBody_->CreateFixture(&_FixtureDef);
}

- (void)destroyBody
{
	[super destroyBody];
	fixtureBody_ = NULL;
}

@end